package com.project.controller.web;

import com.project.entity.User;
import com.project.myBeans.R;
import com.project.service.RecruitInfoService;
import com.project.service.UserService;
import com.project.service.base.BaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: TateBrown
 * @date: 2018/5/26 17:37
 * @param:
 * @return:
 */
@EnableAutoConfiguration
@RestController
@RequestMapping("/enterprise")
@Api(description = "企业相关", value = "enterprise")
public class EnterpriseController extends BaseService{
    @Autowired
    RecruitInfoService recruitInfoService;
    @Autowired
    UserService userService;
    /**
     * TateBrown 2018年5月26日
     *
     * @param id
     * @return
     */
    @ApiOperation("根据用户id查找用户")
    @GetMapping("/searchPersonInfo/{id}")
    public R findOneById(@PathVariable("id") Integer id){
        User user=null;
        try{
            user=userService.findOneByUserID(id);
        }catch (Exception e){
            e.printStackTrace();
            return R.error();
        }
        return R.ok("查询成功").put("data",user);
    }
}
